package com.pearlsoft.webapp.sysmgr.cachemgr;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;

import com.pearlsoft.webapp.core.annotation.DataSetHandlerComponent;
import com.pearlsoft.webapp.core.annotation.QueryHandlerComponent;
import com.pearlsoft.webapp.core.dataset.DataSet;
import com.pearlsoft.webapp.core.dataset.Result;
import com.pearlsoft.webapp.core.web.basehandler.AbsDataSetHandler;
import com.pearlsoft.webapp.sysmgr.cache.CacheService;


@DataSetHandlerComponent(name = "CacheDataSetHandler")
public class CacheDataSetHandler extends AbsDataSetHandler{

	@Override
	public void handler(DataSet ds, Result result) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void save(DataSet ds, Result result) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void delete(DataSet ds, Result result) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void deleteAll(DataSet ds, Result result) throws Exception {
		// TODO Auto-generated method stub
		
	}
	
	public void clearCache(DataSet ds,Result result) throws Exception{
		String cacheName =(String) ds.getConditions().get("cacheName");
		CacheService cacheService = this.getBean("cacheService", CacheService.class);
		cacheService.clear(cacheName);
	}

}
